<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script type="text/javascript" src="../../js/vue.js"></script>

</head>
<body>
    <div id="root">
        <form @submit.prevent="submit">
            <label for="demo1">账号：</label>
            <input type="text" id = "demo1" v-model.trim="account"> <br/>
            密码：<input type="password" v-model="password"><br/>
            年龄：<input type="number"   v-model.number="age" ><br/>
            性别：
            男<input type="radio" name="sex"  v-model="sex" value="male">
            女<input type="radio" name="sex" v-model="sex"  value="female"><br/>
            爱好:
            学习<input type="checkbox" v-model="hobby" value="study">
            听歌<input type="checkbox"  v-model="hobby" value="music">
            看电影<input type="checkbox"  v-model="hobby" value="movie">
            <br/>
            所属校区：
            <select v-model="city">
                <option value="">请选择校区</option>
                <option value="beijing">北京</option>
                <option value="shanghai">上海</option>
                <option value="guangzhou">广州</option>
            </select>
            <br/>
            其他信息：
            <textarea v-model.lazy="other"></textarea>
            <br/>
            <input type="checkbox" v-model="agree"> 阅读并接受协议<a href="http://www.baidu.com"></a>
            <br/>
            <button>提交</button>
        </form>
    </div>

    <script type="text/javascript">
        Vue.config.performance = false;
        const vm = new Vue({
            el:'#root',
            data:{
                account:'',
                password:'',
                age:'',
                sex:'female',
                hobby:[],
                city:'beijing',
                other:'',
                agree:'',

            },
            methods:{
                submit(){
                    //alert('111')
                    console.log(JSON.stringify(this._data))
                }
            }
        })

    </script>

</body>
</html>